package com.bootdo.hotel.dao;

import com.bootdo.hotel.domain.HotelOrder;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 酒店订单
 * @author haojiangbo
 * @email 2100272728@qq.com
 * @date 2019-10-19 08:50:34
 */
@Mapper
public interface HotelOrderDao {

	HotelOrder get(Long id);

	@Select("SELECT * FROM me_hotel_order where member_mobile = #{mobile} and in_date <= date_format(NOW(),'%Y-%m-%d') and out_date >= date_format(NOW(),'%Y-%m-%d')  and status = 1 limit 1 ")
	HotelOrder getByMobileByInRoom(@Param("mobile") String mobile);


	List<HotelOrder> list(Map<String,Object> map);
	
	int count(Map<String,Object> map);
	
	int save(HotelOrder hotelOrder);
	
	int update(HotelOrder hotelOrder);
	
	int remove(Long id);
	
	int batchRemove(Long[] ids);
}
